package cn.cjp.m3d26;

public class cStringBuilder {
    public static void main(String[] args) {
        //构造方法
        StringBuilder bu1 = new StringBuilder();
        StringBuilder bu2 = new StringBuilder("dfjfj");
        System.out.println("bu1 "+bu1);
        System.out.println("bu2 "+bu2);
        System.out.println("=============");

        //成员方法
        //添加数据   返回值是本身，故可不用返回值
        bu1.append(1+"ab");
        System.out.println("bu1 "+bu1);
        bu1.append(true).append("cv");
        System.out.println("bu1 "+bu1);
        System.out.println("=============");

        //StringBuilder转换String
        String str = bu1.toString();
        System.out.println(str);
        System.out.println("=============");

        //反转内容
        bu1.reverse();
        System.out.println("bu1 "+bu1);
    }
}
